1. Field of the Invention
The present invention relates to an image processing apparatus and method and an information providing medium. In particular, the invention relates to an image processing apparatus and method and an information providing medium which can generate image data more quickly according to a ray tracing method.
2. Description of the Related Art
FIG. 1 illustrates the principle of a conventional ray tracing method. As shown in FIG. 1, in generating data of a target pixel at a prescribed position on a screen 52, a ray (first ray) that goes from an eye point 51 at a preset position to the target pixel on the screen 52 is assumed and the first ray is caused to strike a prescribed object (object 53 in this example) that is located in a three-dimensional coordinate space. An image portion of the point on the object 53 at which the first ray strikes should be rendered at the target pixel on the screen 52.
Where a ray emitted from a light source 55 is reflected by an object 54 and shines on the above point on the object 53, the image portion of the point on the object 53 at which the first ray strikes is also influenced by this ray. Therefore, by retracing this ray from the above point on the object 53 to the light source 55, a second ray is assumed that goes from the object 53 to the object 54 and a third ray is assumed that goes from the object 54 to the light source 55. The image portion of the point on the object 53 that is struck by the first ray is corrected by calculating influences of the second and third rays. As a result, the target pixel on the screen 52 comes to reflect a correction result.
In CAD, for example, a plurality of objects are generated and disposed in a prescribed three-dimensional coordinate space and an image of those three-dimensional objects as viewed from a prescribed eye point can be calculated as an image on the screen 52 and then displayed in the above manner.
However, the above method according to ray tracing has a problem that since it is necessary to judge what objects rays at each stage strike, the amount of calculation is enormous and it is more difficult to increase the processing speed than in the polygon rendering method etc.
The present invention has been made in the above circumstances and an object of the invention is therefore to make it possible to generate image data more quickly.
The invention provides an image processing apparatus which converts objects in a three-dimensional coordinate space to image data on a screen, comprising projecting means for generating image data by projecting data representing surfaces of the object onto a screen coordinate system; interpolating means for generating pixel data inside the surfaces on the screen coordinate system by interpolation based on the projected image data on the screen coordinate system; and correcting means for generating a ray for a point on the object that corresponds to the pixel data generated by the interpolating means, and for generating correction information for correcting a value of the pixel data on the screen coordinate system based on a judgment of intersection of the ray with another objects.
According to another aspect of the invention, there is provided an image processing method for converting objects in a three-dimensional coordinate space to image data on a screen, comprising a projecting step of generating image data by projecting data representing surfaces of the objects onto a screen coordinate system; an interpolating step of generating pixel data inside the surfaces on the screen coordinate system by interpolation based on the projected image data on the screen coordinate system; and a correcting step of generating a ray for a point on the object that corresponds to the pixel data generated by the interpolating step, and for generating correction information for correcting a value of the pixel data on the screen coordinate system based on a judgment of intersection of the ray with another objects.
According to a further aspect of the invention, there is provided an information providing medium for providing a program that causes an image processing apparatus to execute a process of converting objects in a three-dimensional coordinate space to image data on a screen, the process comprising a projecting step of generating image data by projecting data representing surfaces of the objects onto a screen coordinate system; an interpolating step of generating pixel data inside the surfaces on the screen coordinate system by interpolation based on the projected image data on the screen coordinate system; and a correcting step of generating a ray for a point on the object that corresponds to the pixel data generated by the interpolating step, and for generating correction information for correcting a value of the pixel data on the screen coordinate system based on a judgment of intersection of the ray with another objects.